package com.example.backend.mapper;


import com.example.backend.entity.Admin;
import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Repository;

import java.util.ArrayList;
@Repository
public interface AdminMapper {
    @Delete("delete from admin where id = #{id}")
    int doDelete(String id);
    @Insert("insert into admin(id,name,pwd,realname) values(#{id},#{name},#{pwd},#{realname})")
    int doRegister(Admin admin);
    @Select("select * from admin where id = #{id}")
    Admin getAdminById(String id);

    @Select("select * from admin where name = #{name}")
    Admin selectByAdminname(String name);

    @SelectProvider(type = AdminMapperProvider.class,method = "getSelectAdminsSql")
    ArrayList<Admin> doList(Admin admin);
    @UpdateProvider(type = AdminMapperProvider.class,method = "getUpdateAdminSql")
    int doUpdate(Admin admin);

}